package cn.didi.feidi.androidorder.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.ArrayList;

import cn.didi.feidi.androidorder.fragment.MainOrderItemFragment;

/**
 * Created by jinxiong on 2017/8/20.
 */

public class MainOrderViewPagerAdapter extends FragmentPagerAdapter {


    private final String[] titles = {"待付款", "待接收", "待收货", "售后"};
    private ArrayList<MainOrderItemFragment> fragments;

    public MainOrderViewPagerAdapter(FragmentManager fm, ArrayList<MainOrderItemFragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}

